const { defineConfig } = require('@vue/cli-service')
const path = require('path')
module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,

  pluginOptions: {
    'style-resources-loader': {
      preProcessor: 'less',
      patterns: [
        path.join(__dirname,'./src/assets/styles/variables.less'),
        path.join(__dirname,'./src/assets/styles/mixins.less')
      ]
    }
  },
  devServer: {
    proxy: {
      '/api': {
        target: 'http://localhost:8090',  //本地数据接口
        // ws: true,
        changeOrigin: true,
        pathRewrite: { //重写路径
          '^/api':'/'
        }
      },
      '/foo': {
        target: 'http://localhost:7788', //本地接口
        // ws: true,
        changeOrigin: true,
        pathRewrite: { //重写路径
          '^/foo':''
        }
      }
    },
  }
})
